<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // window.navigator


        function checkBrowser() {
            var userAgent = navigator.userAgent;
            console.log(userAgent);
            if (userAgent.indexOf('Opera') > -1) {
                return 'Opera'
            }
            if (userAgent.indexOf('Firefox') > -1) {
                return 'Firefox'
            }
            if (userAgent.indexOf('Chrome') > -1) {
                return 'Chrome'
            }
            if (userAgent.indexOf('Safari') > -1) {
                return 'Safari'
            }
            if (userAgent.indexOf('compatible') > -1 && userAgent.indexOf('MSIE') > -1 &&
                userAgent.indexOf('Opera') === -1) {
                return 'IE'
            }
        }
        console.log(checkBrowser());
        // 网络类型
        console.log(navigator.connection.effectiveType);
        // window.history 记录窗口浏览页面
        // history.length 记录窗口浏览页面的个数
        // history.back() 回退
        // history.forward() 前进
        // history.go(value) value
    </script>
</body>

</html>